// var i;
// var $macros = require("./AL_Framework_Macros");
// var s = (function (e) {
//     function t() {
//         return (null !== e && e.apply(this, arguments)) || this;
//     }
//     __extends(t, e);
//     Object.defineProperty(t.prototype, "yinyue_kaiguan_zhuangtai", {
//         get: function () {
//             return this._musicState;
//         },
//         set: function (e) {
//             this._musicState = e;
//             localStorage.setItem(ailin.Key_Music, String(e));
//             Manager.eventCenter.emit($macros.Macro.CHANGE_MUSIC_EVENT, e);
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(t.prototype, "yinxiao_kaiguan_zhuangtai", {
//         get: function () {
//             return this._sfxState;
//         },
//         set: function (e) {
//             this._sfxState = e;
//             localStorage.setItem(ailin.Key_Sound, String(e));
//             Manager.eventCenter.emit($macros.Macro.CHANGE_SFX_EVENT, e);
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(t.prototype, "zhendong_zhuangtai", {
//         get: function () {
//             return this._vibrateState;
//         },
//         set: function (e) {
//             this._vibrateState = e;
//             localStorage.setItem(ailin.Key_Vibrate, String(e));
//             Manager.eventCenter.emit($macros.Macro.CHANGE_VIBRATE_EVENT, e);
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     Object.defineProperty(t.prototype, "language", {
//         get: function () {
//             return this._language;
//         },
//         set: function (e) {
//             this._language = e;
//             localStorage.setItem("Key_Language", e);
//             Manager.eventCenter.emit($macros.Macro.CHANGE_LANGUAGE, e);
//         },
//         enumerable: !1,
//         configurable: !0
//     });
//     t.prototype.zhixing_chushihua_chuli = function () {
//         var e = localStorage.getItem(ailin.Key_Music);
//         this._musicState = !e || "true" == e || "1" == e;
//         var t = localStorage.getItem(ailin.Key_Sound);
//         this._sfxState = !t || "true" == t || "1" == t;
//         var o = localStorage.getItem(ailin.Key_Vibrate);
//         this._vibrateState = !o || "true" == o || "1" == o;
//         var i = localStorage.getItem("Key_Language");
//         this._language = i || window.language;
//     };
//     return t;
// })(require("./AL_Framework_Storage_Class").AL_Framework_Storage_Class);
// exports.default = s;


const $macros = require("./AL_Framework_Macros");

class Settings extends (require("./AL_Framework_Storage_Class").AL_Framework_Storage_Class) {


    constructor() {
        super();
    }

    /** 获取和设置音乐状态 */
    get yinyue_kaiguan_zhuangtai() {
        return this._musicState;
    }
    set yinyue_kaiguan_zhuangtai(state) {
        this._musicState = state;
        localStorage.setItem(ailin.Key_Music, String(state));
        Manager.eventCenter.emit($macros.Macro.CHANGE_MUSIC_EVENT, state);
    }

    /** 获取和设置音效状态 */
    get yinxiao_kaiguan_zhuangtai() {
        return this._sfxState;
    }
    set yinxiao_kaiguan_zhuangtai(state) {
        this._sfxState = state;
        localStorage.setItem(ailin.Key_Sound, String(state));
        Manager.eventCenter.emit($macros.Macro.CHANGE_SFX_EVENT, state);
    }

    /** 获取和设置震动状态 */
    get zhendong_zhuangtai() {
        return this._vibrateState;
    }
    set zhendong_zhuangtai(state) {
        this._vibrateState = state;
        localStorage.setItem(ailin.Key_Vibrate, String(state));
        Manager.eventCenter.emit($macros.Macro.CHANGE_VIBRATE_EVENT, state);
    }

    /** 获取和设置语言 */
    get language() {
        return this._language;
    }
    set language(lang) {
        this._language = lang;
        localStorage.setItem("Key_Language", lang);
        Manager.eventCenter.emit($macros.Macro.CHANGE_LANGUAGE, lang);
    }

    /** 初始化设置信息 */
    zhixing_chushihua_chuli() {
        const yinyue_kaiguan_zhuangtai = localStorage.getItem(ailin.Key_Music);
        this._musicState = !yinyue_kaiguan_zhuangtai || yinyue_kaiguan_zhuangtai === "true" || yinyue_kaiguan_zhuangtai === "1";

        const yinxiao_kaiguan_zhuangtai = localStorage.getItem(ailin.Key_Sound);
        this._sfxState = !yinxiao_kaiguan_zhuangtai || yinxiao_kaiguan_zhuangtai === "true" || yinxiao_kaiguan_zhuangtai === "1";

        const zhendong_zhuangtai = localStorage.getItem(ailin.Key_Vibrate);
        this._vibrateState = !zhendong_zhuangtai || zhendong_zhuangtai === "true" || zhendong_zhuangtai === "1";

        const language = localStorage.getItem("Key_Language");
        this._language = language || window.language;
    }
}

exports.default = Settings;
